﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VOL.Entity.DomainModels;
using VOL.Entity.SystemModels;
using VOL.Team.Comm;

namespace VOL.Team.TeamIServices.Device_Management
{
    /// <summary>
    /// 调用设备台账接口
    /// </summary>
    public interface IEquipmentLedgerService
    {
        /// <summary>
        /// 添加设备
        /// </summary>
        /// <param name="equipment">请求</param>
        /// <returns>返回任务</returns>
        Task<int> AddEquipmentAsync(EquipmentLedger equipment);
        /// <summary>
        /// 更新设备
        /// </summary>
        /// <param name="equipment">请求</param>
        /// <returns>返回任务</returns>
        Task<int> UpdateEquipmentAsync(EquipmentLedger equipment);
        /// <summary>
        /// 单删
        /// </summary>
        /// <param name="id">主键Id</param>
        /// <returns>返回任务</returns>
        Task<int> DeleteEquipmentAsync(int id);
        /// <summary>
        /// 批量删除
        /// </summary>
        /// <param name="ids">主键Id们</param>
        /// <returns>返回任务</returns>
        Task<int> DeleteEquipmentsAsync(List<int> ids);

        // 查询
        Task<EquipmentLedger> GetEquipmentByIdAsync(int id); // 按ID查询
        Task<List<EquipmentLedger>> GetAllEquipmentsAsync(); // 查询所有
        Task<List<EquipmentLedger>> GetFilteredEquipmentsAsync(
            string name = null,
            string code = null,
            int? status = null
        ); // 条件查询（支持名称、编码、状态过滤）

        // 列筛选（动态控制字段返回）
        Task<List<object>> GetEquipmentColumnsAsync(); // 获取所有列配置
        Task UpdateColumnVisibilityAsync(string columnName, bool isVisible); // 更新列可见性
        //Task UpdateEquipmentAsync(VOL.WebApi.Controllers.Team.wyx.EquipmentLedger equipmentLedger);
        /// <summary>
        /// 查询设备台账列表，支持分页和条件查询
        /// </summary>
        /// <param name="query">请求</param>
        /// <returns>返回任务</returns>
        APIPaging<EquipmentLedger> EquipmentLedgerQuery(Query_Condition_EL query);
    }
}
